package com.bbva.general.generics;

import com.bbva.general.generics.AbstractHibernateDAOImpl;
import com.bbva.general.generics.Constantes;
import com.bbva.general.dao.DatosgeneralesDAOImpl;
import com.bbva.general.dao.UsuariosDAOImpl;
@SuppressWarnings("unchecked")
public class ControllerHelper extends ServiceGeneric {

	private AbstractHibernateDAOImpl controller;
	
	public AbstractHibernateDAOImpl getController() {
		return controller;
	}

	public void setController(AbstractHibernateDAOImpl controller) {
		this.controller = controller;
	}
	
	public void establecerController(String idController){
		AbstractHibernateDAOImpl controller = null;
		if(idController.equals(Constantes.CONTROLLER_DATOS_GENERALES)){
			controller = (DatosgeneralesDAOImpl)getSpringBean(idController);		
		}else if(idController.equals(Constantes.CONTROLLER_USUARIOS)){
			controller = (UsuariosDAOImpl)getSpringBean(idController);			
		}
		System.out.println(idController + " desde el helper");
		setController(controller);
	}
	
}
